/**
 * Created by Administrator on 2016/4/11.
 */
$("#next").click(function(){
    var style=$("#style").val();
    var user=$("#user").val();
    /* if(style==0){
     alert("请选择找回方式")
     return false;
     }else if(user.length<1){
     alert("请输入用户名")
     return false;
     }else if(style==1){
     window.open("getmobile.html");
     window.close();
     }else if(style==2){
     window.open("getemail.html")
     }*/
}).mousedown(function(){
    $("#next").addClass("l_anniu")
}).mouseout(function(){
    $("#next").removeClass("l_anniu")
});
function Save() {
    var username = $('#user').val();
    var style=$("#style").val();
    if(username.length<1){
        //alert("用户名不能为空");
        $(".timeout p").html("用户名不能为空");
        $(".timeout").show();
        $(".timeout .sure").mousedown(function(){
            $(".sure img").attr("src","images/galert3.png");
        });
        $(".timeout .sure").mouseup(function(){
            $(".sure img").attr("src","images/galert1.png");
            $(".timeout").hide();
        });
        return false;

    }else {
        $.ajax({
            url: "hxclub/member/pwd/getUserInfoPwd.do",
            async: false,
            type: "post",
            dataType: "json",
            data: {"username": "" + username + ""/*, "codes": "" + codes + ""*/},

            success: function (data) {
                var mobile=data.data.mphone;
                var email=data.data.email;
                var id=data.id;
                if (data.success == false) {
                    //alert("账号不存在")
                    $(".timeout p").html("账号不存在");
                    $(".timeout").show();
                    $(".timeout .sure").mousedown(function(){
                        $(".sure img").attr("src","images/galert3.png");
                    });
                    $(".timeout .sure").mouseup(function(){
                        $(".sure img").attr("src","images/galert1.png");
                        $(".timeout").hide();
                    });
                } else {
                    if(style==0){
                        //alert("请选择找回方式")
                        $(".timeout p").html("请选择找回方式");
                        $(".timeout").show();
                        $(".timeout .sure").mousedown(function(){
                            $(".sure img").attr("src","images/galert3.png");
                        });
                        $(".timeout .sure").mouseup(function(){
                            $(".sure img").attr("src","images/galert1.png");
                            $(".timeout").hide();
                        });
                        return false;
                    }else if(style==1){
                        window.location.href = "../getmobile.html?mobile="+mobile;

                    }else if(style==2){
                        window.location.href = "../getemail.html?email="+email;
                    }

                }
            }
        });
    }
}
